package com.onpositive.wikidataeditor;

import java.util.ArrayList;

import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.ISelectionListener;
import org.eclipse.ui.IWorkbenchPart;

import com.onpositive.semantic.ui.workbench.elements.XMLView;

public class FilePropertiesView extends XMLViewWithRecourses {

	public static final String ID = "com.onpositive.wikidataeditor.filePropertiesView";
	

	public FilePropertiesView() {
		super("dlf/file-properties.dlf");
		
	}
	
	public void setFocus() {
	}
	
	@Override
	public void createPartControl(Composite parent) {
		super.createPartControl(parent);
		getSite().getWorkbenchWindow().getSelectionService().addSelectionListener(new ISelectionListener() {
			
			@Override
			public void selectionChanged(IWorkbenchPart part, ISelection selection)
			{
				if (selection instanceof org.eclipse.jface.viewers.IStructuredSelection){
					IStructuredSelection sl=(IStructuredSelection) selection;
					getBinding("FileList").setValue(sl.getFirstElement(), null);
				}
			}
		});
	}
	
}
